<?php
include './vendor/autoload.php';

use Illuminate\Container\Container;
$container = Container::getInstance();


class A {
    public function index()
    {
        echo '最底层依赖';
    }
}

class B
{
    public function __construct(A $a)
    {
        echo 'a';
    }

    public function index()
    {
        echo '倒数第二层依赖';
    }
}
class C
{
    public function __construct(B $b)
    {
        echo 'b';
    }
    public function index()
    {
        echo '倒数第3层依赖';
    }
}
class shiyong
{
    public function __construct(C $c)
    {
        echo 'c';
    }
    public function index(C $c)
    {
        echo '使用中的类';
    }
}

$instance = $container->make(shiyong::class);
